import 'package:flutter/foundation.dart' show kIsWeb;
import 'dart:io' show Platform;

class PlatformChecker {
  static bool get isAndroid {
    try {
      return !kIsWeb && Platform.isAndroid;
    } catch (e) {
      return false;
    }
  }

  static bool get isIOS {
    try {
      return !kIsWeb && Platform.isIOS;
    } catch (e) {
      return false;
    }
  }

  static bool get isWeb => kIsWeb;

  static bool get isDesktop {
    try {
      return !kIsWeb &&
          (Platform.isWindows || Platform.isMacOS || Platform.isLinux);
    } catch (e) {
      return false;
    }
  }
}
